home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-02-20 | 1016 b | 39 lines | [TEXT/CWIE] |
-
- #include "ScriptErrors.h"
- #include "MoreAEM.h"
-
- //
- // For kOSAErrorOffendingObject and nothing else
- //
- #include "OSA.h"
-
- //----------------------------------------------------------------------------------------
- // ProcessError
- //----------------------------------------------------------------------------------------
- void ProcessError(OSErr err, TDescriptor& offendingObject, TAEvent& reply)
- {
- if((reply.IsNullDescriptor() == false) && (err != noErr))
- {
- //
- // Put the error number into the reply
- //
- reply.PutSInt32Parameter(keyErrorNumber, err);
-
- //
- // At this point the application should look up an appropriate
- // error string, if it can generate one, and place it into
- // the parameter keyErrorString.
- //
-
- //
- // Put a reference to the offending object into the
- // reply as well (if one is available)
- //
- if(offendingObject.IsNullDescriptor() == false)
- {
- reply.PutDescriptorParameter(kOSAErrorOffendingObject, offendingObject);
- offendingObject.Dispose();
- }
- }
- }
-